Skip to content

fix(schema): allow ANNOTATION_TYPE in storage CHECK constraints#420

Merged
jimisola merged 2 commits into
mainfrom
fix/annotation-type-check-constraint
Jun 23, 2026
Merged

fix(schema): allow ANNOTATION_TYPE in storage CHECK constraints#420
jimisola merged 2 commits into
mainfrom
fix/annotation-type-check-constraint

Conversation

@jimisola

Copy link
Copy Markdown
Member

Summary

Follow-up to #419, which fixed annotations.schema.json's elementKind enum but missed two other independent copies of the same enum:

  • storage/schema.py's annotations_impls/annotations_tests CHECK constraints — these silently dropped the row via INSERT OR IGNORE with no warning logged, so a requirement/SVC with an ANNOTATION_TYPE annotation location passed schema validation but then vanished from the database with no error at all.
  • export_output.schema.json's own element_kind enum copy (used by the export command's output validation, tested by test_output_schemas.py).

Found by re-running reqstool-java-annotations#166's CI after merging #419: the schema validation error was gone, but ANNOTATIONS_001 (the requirement self-applied to the Requirements/SVCs annotation declarations themselves) still showed "not implemented" with no error — confirming the CHECK constraint gap was silently swallowing the insert.

Test plan

  • hatch run dev:pytest --cov=reqstool — 938 passed, 2 skipped (unrelated)
  • Reinstalled editable (pipx install --force -e .) against reqstool-java-annotations's real self-applied dataset: full two-pass self-apply build → reqstool status3/3 requirements complete, PASS (previously 2/3, ANNOTATIONS_001 silently missing)

jimisola added 2 commits June 23, 2026 23:08
#419 fixed annotations.schema.json's elementKind enum but missed two
other independent copies of the same enum that also needed the fix:

- storage/schema.py's annotations_impls/annotations_tests CHECK
  constraints -- these silently dropped the row via `INSERT OR IGNORE`
  with no warning logged, so a requirement/SVC with an ANNOTATION_TYPE
  annotation location passed schema validation but then vanished
  from the database with no error at all
- export_output.schema.json's own element_kind enum copy (used by
  the export command's output validation, tested by
  test_output_schemas.py)

Found by re-running reqstool-java-annotations#166's CI: the schema
error from #419 was gone, but ANNOTATIONS_001 (the requirement
self-applied to the Requirements/SVCs annotation declarations
themselves) still showed "not implemented" with no error -- the
CHECK constraint silently swallowing the insert.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
@jimisola jimisola self-assigned this Jun 23, 2026
@jimisola jimisola merged commit d220b35 into main Jun 23, 2026
6 checks passed
@jimisola jimisola deleted the fix/annotation-type-check-constraint branch June 23, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant